One-Pass, Optimal Tree Parsing - With Or Without Trees
نویسندگان
چکیده
This paper describes the theory behind and implementation of wburg, a code-generator generator that accepts tree grammars as input and produces a code generator that emits an optimal parse of an IR tree in just a single bottom-up pass. Furthermore, wburg eliminates the need for an explicit IR tree altogether. The grammars that wburg-generated parsers can parse are a proper subset of those that two-pass systems can handle. However, analysis indicates that wburg can optimally handle grammars for most instruction sets (e.g., SPARC, MIPS R3000, and x86). 1 I n t r o d u c t i o n Compilers often use intermediate representation (IR) trees to represent expressions. A compiler's front end generates an IR tree, and the back end walks the tree, emitting appropriate assembly language instructions and operands. Several automatically generated code generators perform pattern matching on IR trees to emit optimal code. The code-generator generator consumes a costaugmented tree grammar with associated semantic actions. The resulting code generator requires two passes over the IR tree to determine a least-cost parse and to execute the associated semantic actions. Code-generator generators based on this model include BEG [ESL89], twig [AGT89], burg [FHP92b, Pro92], i bu rg [FHP92a], and i b u r g [FH95]. This paper describes the theory behind and implementation of wburg, a codegenerator generator that accepts tree grammars as input and produces a code generator that emits an optimal parse of an IR tree in just a single bot tom-up pass. Furthermore, wburg eliminates the need for an explicit IR tree altogether. The generated parser emits optimal code, and can do so without retaining an entire IR tree during its single pass. The grammars that wburg-generated parsers can parse are a proper subset of those that the two-pass systems can handle. However, analysis indicates that wburg can optimally handle grammars for most major instruction sets, including the SPARC, the MIPS R3000, and the x86.
منابع مشابه
مدل سازی ریسک سقوط درختان چنار خطرآفرین در فضای سبز شهری
Trees in urban areas have survived in a wide variety of conditions and constrains, whether developing in natural or manmade habitats. Due to environmental constrains and stresses, urban trees rarely achieve their biological potentials. Indeed, some of trees, in small groups, could excel in terms of age, biomass structure and dimensions in urban areas. In definition, tree hazard includes entirel...
متن کاملA Case Study on Example-Based Parsing
The paper describes an example-based parser for Chinese: Tree structure whose size is equal or smaller than the sentence to be parsed are retrieved from a treebank and aligned with the sentence. Subsequent structural adaptations handle unknown words, type shifting and metaphorical extensions of words. Derivational adaptations reanalyze awkward subtrees in order to auto-correct badly matched tre...
متن کاملEfficient Retargetable Code Generation Using Bottom-up Tree Pattern Matching
Instruction selection is the primary task in automatic code generation. This paper proposes a practical system for performing optimal instruction selection based on tree pattern matching for expression trees. A significant feature of the system is its ability to perform code generation without requiring cost analysis at code generation time. The target machine instructions are specified as attr...
متن کاملFinding Optimal 1-Endpoint-Crossing Trees
Dependency parsing algorithms capable of producing the types of crossing dependencies seen in natural language sentences have traditionally been orders of magnitude slower than algorithms for projective trees. For 95.899.8% of dependency parses in various natural language treebanks, whenever an edge is crossed, the edges that cross it all have a common vertex. The optimal dependency tree that s...
متن کاملA New Algorithm for Optimization of Fuzzy Decision Tree in Data Mining
Decision-tree algorithms provide one of the most popular methodologies for symbolic knowledge acquisition. The resulting knowledge, a symbolic decision tree along with a simple inference mechanism, has been praised for comprehensibility. The most comprehensible decision trees have been designed for perfect symbolic data. Classical crisp decision trees (DT) are widely applied to classification t...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1996